﻿/// <reference path="../jquery-1.8.2.intellisense.js" />
/// <reference path="ajax_hack_gc.js" />
/// <reference path="../../bootstrap-3.3.5-dist/bootstrap-3.3.5-dist/js/bootstrap.min.js" />
//var height = $(document.body).height();
//$("#footer").attr("style", "margin-top:" + height + "px;");
$(function () {
    

    //个人按钮组
    $("#haoidea_personal-head-btn *").css({ "margin-left": "20px" });

    $("#btnAdd").click(function () {
        $("#gc-bottom").load("/Home/Add_Inspiration", function () {
            $('#myModal').modal({
                show: true,
                backdrop: true
            });
            $("#Modal-Add").click(function () {
                if ($.trim($("#txt_idea-dec").val()) == "") {
                    alert("请填写灵感描述");
                    return false;
                }
                ajaxK_V(
                    "post", false, false,
                    {
                        idea_dec: $.trim($("#txt_idea-dec").val()),
                        idea_publisher: $.trim($("#txt_idea-publisher").val()),
                        idea_ByQQ: $("#uid").val()
                    }, "/Home/Add", "json", function (data) {
                        $('#myModal').modal("hide");
                        location.href = "/Home/Index";
                    });
            });
        });
    });
})


function btnDelete(idea_Id) {
    $("#gc-bottom").load("/Home/Delete_Inspiration", function () {
        $('#myModal').modal({
            show: true,
            backdrop: true
        });
        $("#Modal-Delete").click(function () {
            if ($.trim($("#txt_opPwd").val()) == "") {
                alert("请输入临时操作密码");
                return false;
            }
            ajaxK_V(
                "post", false, false,
                {
                    idea_Id: idea_Id,
                    idea_opPwd: $.trim($("#txt_opPwd").val())
                }, "/Home/Delete", "json", function (data) {
                    if (data.res == "Success") {
                        $('#myModal').modal("hide");
                        location.href = "/Home/Index";
                    }
                    else {
                        alert("删除失败!");
                    }

                });
        });
    });
};